Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for new lints and following kebab-case for naming R files #260

Merged
merged 46 commits into from
Jan 13, 2024

Conversation

IndrajeetPatil
Copy link
Owner

@IndrajeetPatil IndrajeetPatil commented Nov 21, 2023

  • clean new lints
  • adopt consistent naming schema for R files (kebab-case)

The code used for the latter:

library(fs)
library(stringr)
library(dplyr)
library(purrr)

old_full_file_names <- dir_ls(recurse = TRUE, glob = "*.R")
extract_file_names <- function(filenames) {
  filenames %>%
    basename() %>%
    tools::file_path_sans_ext()
}

old_filenames <- extract_file_names(old_full_file_names)
new_filenames <- stringr::str_replace_all(old_filenames, "_", "-")

new_full_file_names <- purrr::pmap_chr(
  list(old_full_file_names, old_filenames, new_filenames),
  stringr::str_replace
) %>%
  unname()

purrr::walk2(
  old_full_file_names,
  new_full_file_names,
  ~ fs::file_move(.x, .y)
)

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (325c48d) 100.00% compared to head (5d61b96) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #260   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          495       495           
=========================================
  Hits           495       495           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@IndrajeetPatil IndrajeetPatil changed the title Check for new lints Check for new lints and following kebab-case for naming R files Dec 9, 2023
@IndrajeetPatil IndrajeetPatil merged commit 49efb5d into main Jan 13, 2024
25 checks passed
@IndrajeetPatil IndrajeetPatil deleted the lints-nov23 branch January 13, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant